#!/usr/bin/perl
#
#

sub expand {
	my $s = shift;
	$s =~ s/S/lr/g;
	$s =~ s/L/lSr/g;
	$s =~ s/rl/L/g;
	$s =~ s/[lr]/L/g;
	$s;
}

my $times = int shift @ARGV;
my $tau = (1 + sqrt 5) / 2;

my $o = 'LS';
my %k = (
	L => $tau,
	S => 1,
);
for (0 .. $times) {
	my @i = split '', $o;
	my $n = 0;
	my @o;
	push @o, $n;
	for (@i) {
		$n += $k{$_};
		push @o, $n;
	}
	$n /= 2;
	@o = map { $_ - $n } @o;
	print join ' ', @o;
	print "\n";
	last if $_ == $times;
	$o = expand $o;
	$k{$_} /= $tau for keys %k;
}
